import request from '@/utils/request'
// 关闭客户
export function closeCustomerRequest(merchantCustomerId) {
  return request({
    method: 'get',
    url: 'merchant/customer/operate/close',
    params: {
      merchantCustomerId: merchantCustomerId
    }
  }, true)
}
// 重新打开客户
export function reopenCustomerRequest(merchantCustomerId) {
  return request({
    method: 'get',
    url: 'merchant/customer/operate/reopen',
    params: {
      merchantCustomerId: merchantCustomerId
    }
  }, true)
}
export function detail(id) {
  return request({
    method: 'get',
    url: 'merchant/customer/detail',
    params: {
      merchantCustomerId: id
    }
  }, true)
}
export function getOpportunity(id) {
  return request({
    method: 'get',
    url: 'merchant/opportunity/detail',
    params: {
      opportunityId: id
    }
  }, true)
}
export function listFollowLog(params) {
  return request({
    method: 'get',
    url: 'merchant/customer/follows',
    params: params
  })
}

export function saveOrUpdateCustomer(params) {
  return request({
    method: 'post',
    url: 'merchant/customer/edit',
    data: params
  })
}

export function batchOpportunity(params) {
  return request({
    method: 'post',
    url: 'merchant/opportunity/batch',
    data: params
  }, true)
}
export function addOpportunity(data) {
  return request({
    method: 'post',
    url: 'merchant/opportunity/add',
    data: data
  }, true)
}
export function updateOpportunity(params) {
  return request({
    method: 'post',
    url: 'merchant/opportunity/update',
    data: params
  }, true)
}

export function updateOpportunityFinish(opportunityId) {
  return request({
    method: 'post',
    url: 'merchant/opportunity/update/finish',
    params: {
      opportunityId: opportunityId
    }
  }, true)
}

export function updateOpportunityClose(opportunityId) {
  return request({
    method: 'post',
    url: 'merchant/opportunity/update/close',
    params: {
      opportunityId: opportunityId
    }
  }, true)
}

export function submitCustomerListen(data) {
  return request({
    url: 'merchant/listen/submit',
    method: 'post',
    data: data
  }, true)
}

export function getCustomerListen(listenId) {
  return request({
    url: 'merchant/listen/detail',
    method: 'get',
    params: {
      listenId: listenId
    }
  }, true)
}

export function submitListenFeedback(data) {
  return request({
    url: 'merchant/listen/feedback',
    method: 'post',
    data: data
  }, true)
}
